package net.huashitong.ssydt.money.entity.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import net.huashitong.ssydt.money.constant.MoneyConsts;
import net.huashitong.ssydt.money.entity.SsMoneyVipBag;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2017.08.14
 */
@ApiModel(value = "VipBagsVo", description = "vip套餐包")
public class VipBagsVo implements Serializable {

    @ApiModelProperty(value = "套餐包Id")
    private Long id;//套餐包Id

    @ApiModelProperty(value = "原价", dataType = "BigDecimal")
    private BigDecimal originalPrice;//原价

    @ApiModelProperty(value = "价格", dataType = "BigDecimal")
    private BigDecimal price;//价格

    @ApiModelProperty(value = "名称")
    private String bagName;//名称

    @ApiModelProperty(value = "描述")
    private String description;//描述

    @ApiModelProperty(value = "苹果商品id")
    private String appleGoodsId;//苹果商品id

    @ApiModelProperty(value = " app类型")
    private String appType;// app类型

    public VipBagsVo() {
    }

    public VipBagsVo(SsMoneyVipBag ssMoneyVipBag) {
        super();
        this.setId(ssMoneyVipBag.getId());
        this.setBagName(ssMoneyVipBag.getBagName());
        this.setDescription(ssMoneyVipBag.getDescription());
        this.setOriginalPrice(ssMoneyVipBag.getOriginalPrice());
        this.appleGoodsId = ssMoneyVipBag.getAppleGoodsId();
        this.appType = ssMoneyVipBag.getAppType();
        switch (ssMoneyVipBag.getNowExecute()) {
            case MoneyConsts.NowExecute.ORIGINA_PRICE:
                this.setPrice(ssMoneyVipBag.getOriginalPrice());
                break;
            case MoneyConsts.NowExecute.FAVOURABLE_PRICE:
                this.setPrice(ssMoneyVipBag.getFavourablePrice());
                break;
            case MoneyConsts.NowExecute.PREFERENCE_PRICE:
                this.setPrice(ssMoneyVipBag.getPreferencePrice());
                break;
            default:
                this.setPrice(ssMoneyVipBag.getOriginalPrice());
        }
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public BigDecimal getOriginalPrice() {
        return originalPrice;
    }

    public void setOriginalPrice(BigDecimal originalPrice) {
        this.originalPrice = originalPrice;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getBagName() {
        return bagName;
    }

    public void setBagName(String bagName) {
        this.bagName = bagName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getAppleGoodsId() {
        return appleGoodsId;
    }

    public void setAppleGoodsId(String appleGoodsId) {
        this.appleGoodsId = appleGoodsId;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("VipBagsVo{");
        sb.append("id=").append(id);
        sb.append(", originalPrice=").append(originalPrice);
        sb.append(", price=").append(price);
        sb.append(", bagName='").append(bagName).append('\'');
        sb.append(", description='").append(description).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
